from flair import models
from inspect import getmembers, isfunction

function_lists = [ o for o in getmembers(models) if isfunction(o[1]) ] 
print("There are " + str(len(function_lists)) + "models in total.")

count=0
for net in function_lists:
    print(str(count) + "jit scripting network:" + net[0])
    try:
        count=count+1 
        torch.jit.script(net[1]())
    except RuntimeError as err:
        print("the network" + model + "can't be converted.")
        print("reson: " + str(err))
